package com.wechat.page.contact.misc;

import com.swak.fx.support.ui.UILabel;

import javafx.beans.property.BooleanProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.geometry.Pos;
import javafx.scene.layout.StackPane;

public class Title extends StackPane {

	private final String[] STYLE_CLASS = { "contact__title" };
	private UILabel text;

	public Title(String text) {
		this.getStyleClass().addAll(STYLE_CLASS);
		this.text = new UILabel(text);
		this.getChildren().add(this.text);
		StackPane.setAlignment(this.text, Pos.BOTTOM_LEFT);
		this.nonBorderProperty().addListener((ob, o, n) -> {
			if (n) {
				this.getStyleClass().add("non-border");
			} else {
				this.getStyleClass().remove("non-border");
			}
		});
	}

	private BooleanProperty nonBorderProperty = new SimpleBooleanProperty(false);

	public BooleanProperty nonBorderProperty() {
		return nonBorderProperty;
	}
}
